/**
 * 
 */
package src.model.gameObject.ability;

import src.model.gameObject.PlayerGameObject;
import src.model.gameWorld.ActualMap;
import src.model.gameWorld.PlayerLookupTable;

/**
 * <b>Overview</b><br>
 * <p>This class constructs the necessary ActiveAbilities to populate in a PlayerGameObject. This allows an abilityType to
 * be passed in, and get the proper ActiveAbility out, without having to know what type it was.</p>
 * <br><br>
 * <b>Responsibilites</b><br>
 * <p>Create ActiveAbilities.</p>
 * <br><br>
 * <b>Collaborators</b>
 * <ul>
 * <li>AbilityType - To know which Ability to construct.</li>
 * <br><br>
 * <b>Implementor:</b> Tristan Lohman<br>
 * <b>Tester:</b> Brent Mofitt<br>
 * @author Tristan
 *
 */
public class ActiveAbilityFactory {
	
	/**
	 * This will construct an active ability with the parameters passed in. The AbilityType determines which ActiveAbilty
	 * will be created. The rest of the parameters are necessary for the various constructors.<br>
	 * NOTE: Not all ActiveAbilities have been implemented yet, so many of the constructors are incomplete.
	 * @param pgo The PlayerGameObject that this will belong to.
	 * @param aType The AbilityType. Determines which constructor to call.
	 * @param playerLookup The PlayerLookupTable that most constructors will need.
	 * @param am The ActualMap that many constructors need.
	 * @return The ActiveAbility created.
	 */
	public static ActiveAbility constructActiveAbility(PlayerGameObject pgo, AbilityType aType, PlayerLookupTable playerLookup, ActualMap am){
		switch(aType){
		case STOPHARVESTING:	return new StopHarvesting(pgo);
		case REMOVEITEM:		return new RemoveItem(pgo);
		case MOVE:				return new Move(pgo, playerLookup, am);
		case MELEEATTACK:		return new MeleeAttack(pgo, playerLookup, am);
		case LOADUNIT:			return new LoadUnit(pgo, am);
		case PICKUPITEM:		return new PickupItem(pgo);
		case HEAL:				return new Heal(pgo, playerLookup, am);
		case SETTRAP:			return new SetTrap(pgo);
		case OBSERVE:			return new Observe(pgo);
		case SNEAK:				return new Sneak(pgo, playerLookup);
		case RANGEDATTACK:		return new RangedAttack(pgo, playerLookup, am);
		case BUILDUNIT:			return new BuildUnit(pgo);
		case BUILDSTRUCTURE:	return new BuildStructure(pgo);
		case HARVESTRESOURCE:	return new HarvestResource(pgo);
		case REMOVETRAP:		return new RemoveItem(pgo);
		default:				return null;
		}
	}
}
